<template>
  <div>
    <el-row style="margin-left:13px;">
      <div>
        <i
          style="font-size:20px"
          class="el-icon-info"
          @click="showSingeInfo"
        ></i>
      </div>
    </el-row>
    <el-dialog
      title="跟进详情"
      :visible.sync="showDialogVisible"
      width="90%"
      center
    >
      <div>
        <el-table
          :data="tableData"
          class="text-sm elTable"
          style="width: 100%"
          :header-cell-style="{'text-align':'left'}"
          :cell-style="{'text-align':'left'}"
          v-if="null != tableData && tableData.length > 0"
        >
          <el-table-column prop="accompanyingPersonnel" label="随行人员" class="cell" width="150px">
            <template  slot-scope="scope">
              <div v-for="(item, index) in scope.row.accompanyingPersonnel">{{
                userSource[item]
              }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="visitMode" label="拜访方式" class="cell" width="150px">
            <template  slot-scope="scope">
              <div>{{
                visitModeSource[scope.row.visitMode]
                }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="visitPlace" label="拜访地址" class="cell" width="200px">
          </el-table-column>
          <el-table-column prop="visitObjective" label="拜访目的" class="cell">
          </el-table-column>
          <el-table-column prop="visitResult" label="结果反馈" class="cell">
          </el-table-column>
          <el-table-column prop="followedThing" label="待跟进事项" class="cell">
          </el-table-column>
          <el-table-column prop="nextVisitDate" label="下次拜访时间" width="150px">
          </el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import { ajax } from "@/store/yg/common/utils";
  import axios from "axios";
  import * as constant from "@/store/yg/common/constant";
  import { m } from "@/store/yg/common/local";
  import Clipboard from "clipboard";

  export default {
    props: ["row", "data", "more"],
    data() {
      return {
        fullscreenLoading: false,
        userSource: {},
        visitModeSource: {},
        titps: "努力加载中",
        tableData: [
        ],
        showDialogVisible: false,
      };
    },

    methods: {
      showSingeInfo() {
        this.showDialogVisible = true;
        this.tableData = {};
        var arrayObj = new Array();
        arrayObj.push(this.data)
        this.tableData=arrayObj;
      },
    },
    mounted() {
      this.userSource = this.$store.state.main.entry.sources["userSource"];
      this.visitModeSource = this.$store.state.main.entry.sources["visitModeSource"];
    }
  };
</script>

<style>
  .top {
    text-align: center;
  }
  .elTable .cell{
    white-space: pre-wrap;
  }
</style>
